<link href="__STATIC__/index/css/main.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="__STATIC__/index/css/page.css" />
<script src="__STATIC__/index/js/jquery.js"></script>
<script src="__STATIC__/index/js/layer/layer.js"></script>
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<style>
  .flexigrid .hDiv th div, .flexigrid .bDiv td div, .colCopy div{height: auto}
</style>
<div class="page">
  <div class="flexigrid">

    <div class="mDiv">
      <div class="ftitle">
        <h3>短信模板列表</h3>
        <h5>(共{$list_count}条记录)</h5>
      </div>
    </div>
    <div class="hDiv">
      <div class="hDivBox">
        <table cellspacing="0" cellpadding="0">
          <thead>
          <tr>
            <th class="sign" axis="col0">
              <div style="width: 24px;"><i class="ico-check"></i></div>
            </th>
            <th align="left" abbr="article_title" axis="col3" class="">
              <div style="text-align: left; width: 50px;" class="">ID</div>
            </th>
            <th align="left" abbr="ac_id" axis="col4" class="">
              <div style="text-align: left; width: 100px;" class="">分类名</div></th>
            <th align="left" abbr="ac_id" axis="col4" class="">
              <div style="text-align: left; width: 200px;" class="">信息内容(点击查看详细)</div></th>
            <th align="center" axis="col1" class="handle">
              <div style="text-align: center; width: 150px;">操作</div>
              
            </th>
            <th style="width:100%" axis="col7">
              <div></div>
            </th>
          </tr>
          </thead>
        </table>
      </div>
    </div>
    <div class="bDiv" style="height: auto;">
      <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
        <table>
          <tbody>
          {volist name="list" id="vo"}
            <tr>
              <td class="sign">
                <div style="width: 24px;"><i class="ico-check"></i></div>
              </td>
              <td align="left" class="">
                <div style="text-align: left; width: 50px;">{$vo.id}</div>
              </td>
              <td align="left" class="">
                <div style="text-align: left; width: 100px;">
                  {$vo.name}
                </div>
              </td>
              <td style="text-align: left;">
                <div onclick="content(this)" class="content" style="width: 200px;height:42px;cursor:pointer">
                  <textarea name="mobile" style="border:1px solid #6E9FDE;width:380px; height:85px; margin-bottom:5px;display: none" class="vo_content" rows="6">{$vo.content}</textarea>
                  {$vo.content}
                </div>
              </td>
              <td align="center" class="handle">
                <div style="text-align: center; width: 170px; max-width:170px;">
                    <a class="btn red" onclick="select(this)"  href="javascript:void(0)">选择</a>
                    <a href="javascript:void(0)" class="btn red" id="{$vo.id}" onclick="del(this)">删除</a>
                </div>
              </td>
              <td align="" class="" style="width: 100%;">
                <div>&nbsp;</div>
              </td>
            </tr>
          {/volist}
          </tbody>
        </table>
      </div>
      <div class="iDiv" style="display: none;"></div>
      <!--分页位置-->
    {$list->render()} 
    </div>
    
  </div>
  <script>
    function content(obj){
      var text = $(obj).text();
      //自定页
      layer.open({
        type: 1,
        skin: 'layui-layer-demo', //样式类名
        closeBtn: 0, //不显示关闭按钮
        anim: 2,
        shadeClose: true, //开启遮罩关闭
        content: "<div style='padding:15px'>"+text+"</div>"
      });
    }

    function select(obj){
      var text = $(obj).parent().parent().parent().find(".vo_content").val();
      //console.log(text);
      parent.$('#content').val(null);
      parent.$('#content').val(text);
      var index = parent.layer.getFrameIndex(window.name);
      parent.layer.close(index);
    }

    function del(obj){
      var id = $(obj).attr('id');
      var url = "{:url('Sms/del_commonly')}";
      var url_ajax = "{:url('Sms/is_ajax_userd')}";
      $.post(url,{id:id},function(result){
        location.href = url_ajax;
      });
    }
  </script>
</div>
</body>
</html>
</html>
